package com.docchatlink.constant;

import lombok.Getter;

/**
 * <p>
 * 文件总结状态
 * </p>
 *
 * @author Mr.piggy
 * @since 2024/3/27
 */
@Getter
public enum SummaryStatusCodeEnum {

    UNSUMMARY("unsummary", "未总结"),
    SUMMARYING("summarying", "总结中"),
    DONE("done", "总结完成"),
    ILLEGAL("illegal", "内容敏感"),
    FAILED("failed", "总结失败"),
    ;

    private String code;

    private String desc;

    SummaryStatusCodeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }


    public static SummaryStatusCodeEnum findByCode(String code) {
        for (SummaryStatusCodeEnum statusEnum : SummaryStatusCodeEnum.values()) {
            if (statusEnum.getCode().equals(code)) {
                return statusEnum;
            }
        }
        return null;
    }
}
